﻿using System;
using System.Collections.Generic;
using System.Text;
using Vortex.Debugging;

namespace Vortex.Audio {

	/// <summary>
	/// Implements file factory for irrKlang audio engine
	/// </summary>
	class SoundFileFactory : IrrKlang.IFileFactory {
		#region IFileFactory Members

		/// <summary>
		/// Opens the file stream.
		/// </summary>
		/// <param name="filename">The filename.</param>
		/// <returns><see cref="System.IO.Stream"/> targeted specified file data.</returns>
		public System.IO.Stream openFile(string filename) {
			Log.Trace("Opening audio file '{0}'", filename ?? "<null>");
			return new Vortex.IO.ResourceFileInfo(filename).OpenStream();
		}

		#endregion
	}
}
